package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommunitySecurityMapper;
import com.ruoyi.system.domain.CommunitySecurity;
import com.ruoyi.system.service.ICommunitySecurityService;

/**
 * 社区安防
Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-29
 */
@Service
public class CommunitySecurityServiceImpl implements ICommunitySecurityService 
{
    @Autowired
    private CommunitySecurityMapper communitySecurityMapper;

    /**
     * 查询社区安防

     * 
     * @param csId 社区安防
ID
     * @return 社区安防

     */
    @Override
    public CommunitySecurity selectCommunitySecurityById(Long csId)
    {
        return communitySecurityMapper.selectCommunitySecurityById(csId);
    }

    /**
     * 查询社区安防
列表
     * 
     * @param communitySecurity 社区安防

     * @return 社区安防

     */
    @Override
    public List<CommunitySecurity> selectCommunitySecurityList(CommunitySecurity communitySecurity)
    {
        return communitySecurityMapper.selectCommunitySecurityList(communitySecurity);
    }

    /**
     * 新增社区安防

     * 
     * @param communitySecurity 社区安防

     * @return 结果
     */
    @Override
    public int insertCommunitySecurity(CommunitySecurity communitySecurity)
    {   communitySecurity.setCreateTime(DateUtils.getNowDate());
        return communitySecurityMapper.insertCommunitySecurity(communitySecurity);
    }

    /**
     * 修改社区安防

     * 
     * @param communitySecurity 社区安防

     * @return 结果
     */
    @Override
    public int updateCommunitySecurity(CommunitySecurity communitySecurity)
    {   communitySecurity.setUpdateTime(DateUtils.getNowDate());
        return communitySecurityMapper.updateCommunitySecurity(communitySecurity);
    }

    /**
     * 批量删除社区安防

     * 
     * @param csIds 需要删除的社区安防
ID
     * @return 结果
     */
    @Override
    public int deleteCommunitySecurityByIds(Long[] csIds)
    {
        return communitySecurityMapper.deleteCommunitySecurityByIds(csIds);
    }

    /**
     * 删除社区安防
信息
     * 
     * @param csId 社区安防
ID
     * @return 结果
     */
    @Override
    public int deleteCommunitySecurityById(Long csId)
    {
        return communitySecurityMapper.deleteCommunitySecurityById(csId);
    }
}
